#!/bin/sh

# Sentinel - IRC Statistical and Operator Services
# ftp.sh - FTP client script
#
# Copyright W. Campbell and others.  See README for more details
# Some code Copyright: Jonathan George, Kai Seidler, ircd-hybrid Team,
#                      IRCnet IRCD developers.
#
# $Id: ftp.sh 7 2010-02-01 19:17:42Z dubkat $

# Insecure script to ftp a file from one machine to another, in this case,
# Sentinel's html file from the local machine to a remote web server.

# 1.  Edit the local_path, remote_path, ftp_username, ftp_password,
#     local_file, remote_file, remote_host, and ftp_binary variables.
# 2.  chmod this script to 700 to prevent other users from reading it.
# 3.  run it manually to make sure it works
# 4.  add a cron entry, for a 10 minute interval:
#     */10 * * * /path/to/ftp.sh

# VARIABLES, change these per #1 above
$local_path=/home/user/Stats
$local_file=stats.html
$remote_path=public_html/stats
$remote_file=stats.html
$ftp_username=user
$ftp_password=pass
$ftp_binary=/usr/bin/ftp
$remote_host=www.network.tld

# Don't change anything below this line.
ftp -n <<ENDL
open $remote_host
quote user $ftp_username
quote pass $ftp_password
lcd $local_path
prompt
binary
cd $remote_path
put $local_file $remote_file
bye
ENDL

